﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;

using Game.Command;
using Game.Controller;

namespace SL
{
    public partial class BottomPanelControl 
    {
        GameController _GameController;

        public BottomPanelControl()
        {
            InitializeComponent();
        }

        public GameController GameController
        {
            get { return _GameController; }
            set { _GameController=value; }
        }

        void textBox1_TextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
        {
            string s = textBox1.Text;

            GameCommand command = Factory.GetGlobalCommand(s);
            if (command != null)
            {
                _GameController.CommandExecutor.Execute(
                    _GameController.GameMapView, 
                    _GameController.GameLevels,
                    Game.Common.GameTurn.Create(),
                    command);
            }

        }
    }
}
